package com.ruoyi.quartz.task;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ruoyi.common.core.domain.entity.WMember;
import com.ruoyi.generator.service.IWBackupRecordService;
import com.ruoyi.weiriya.service.IWMemberChargeRecordService;
import com.ruoyi.weiriya.service.IWMemberDepositRecordService;
import com.ruoyi.weiriya.service.IWMemberService;
import com.ruoyi.weiriya.service.IWOrderService;
import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.ruoyi.common.utils.StringUtils;

import java.util.List;

/**
 * 定时任务调度测试
 * 
 * @author lynn
 */
@Component("ryTask")
public class RyTask
{
    @Autowired
    private IWMemberService memberService;

    @Autowired
    private IWOrderService orderService;

    @Autowired
    private IWMemberChargeRecordService memberChargeRecordService;

    @Autowired
    private IWMemberDepositRecordService depositRecordService;

    @Autowired
    private IWBackupRecordService backupRecordService;


    public void ryMultipleParams(String s, Boolean b, Long l, Double d, Integer i)
    {
        System.out.println(StringUtils.format("执行多参方法： 字符串类型{}，布尔类型{}，长整型{}，浮点型{}，整形{}", s, b, l, d, i));
    }

    public void ryParams(String params)
    {
        System.out.println("执行有参方法：" + params);
    }

    public void ryNoParams()
    {
        System.out.println("执行无参方法");
    }

    /**
     * 每天定时更新用户会员信息
     */
    public void updateMemberTask()
    {
        memberService.updateMemberTask();
    }

    /**
     * 超时自动取消
     */
    public void orderTimeoutTask()
    {
        orderService.orderTimeoutTask();
    }

    /**
     * 检查充电订单状态定时任务
     */
    public void chargeCheckTask()
    {
        memberChargeRecordService.chargeCheckTask();
    }

    /**
     * 一拖十订单状态定时任务
     */
    public void tomChargeCheckTask()
    {
        memberChargeRecordService.tomChargeCheckTask();
    }

    /**
     * 24小时结算
     */
    public void timeoutSettlementTask()
    {
        memberChargeRecordService.timeoutSettlementTask();
        depositRecordService.timeoutSettlementTask();
    }

    /**
     * 定时任务每周备份
     */
    public void systemBackupTask()
    {
        backupRecordService.systemBackupTask();
    }

    /**
    * 定期获取门禁列表
    */
    public void getDoorListTask()
    {
        depositRecordService.getDoorListTask();
    }

    /**
    * 检查充电订单用户余额定时任务
    */
    public void chargeAmountCheckTask()
    {
        memberChargeRecordService.chargeAmountCheckTask();
    }
}
